package com.etop.weibo.beans;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import java.util.Date;

/**
 * <p>fromId----from_id</p> 
 * <p>toId----to_id</p>
 * @author jansing lz_jansing@163.com
 */
@Entity
@Table(name = "t_secret")
public class Secret {

    private int id;
    private int fromId;
    private int toId;
    private String what;
    private Date createTime;
    private boolean isNew;

    public Secret() {
        this.createTime = new Date();
        this.isNew = true;
    }

    public Secret(int fromId, int toId, String what) {
        this();
        this.fromId = fromId;
        this.toId = toId;
        this.what = what;
    }

    public Secret(int fromId, int toId, String what, Date createTime, boolean isNew) {
        this.fromId = fromId;
        this.toId = toId;
        this.what = what;
        this.createTime = createTime;
        this.isNew = isNew;
    }

    public Secret(int id, int fromId, int toId, String what, Date createTime, boolean isNew) {
        this.id = id;
        this.fromId = fromId;
        this.toId = toId;
        this.what = what;
        this.createTime = createTime;
        this.isNew = isNew;
    }

    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name = "from_id")
    public int getFromId() {
        return fromId;
    }

    public void setFromId(int fromId) {
        this.fromId = fromId;
    }

    @Column(name = "to_id")
    public int getToId() {
        return toId;
    }

    public void setToId(int toId) {
        this.toId = toId;
    }

    @Column(name = "what")
    public String getWhat() {
        return what;
    }

    public void setWhat(String what) {
        this.what = what;
    }

    @Column(name = "create_time")
    @Temporal(value = TemporalType.TIMESTAMP)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "isNew")
    public boolean isIsNew() {
        return isNew;
    }

    public void setIsNew(boolean isNew) {
        this.isNew = isNew;
    }

}
